/**
 * @param {string} s1
 * @param {string} s2
 * @return {number}
*/
var minimumSwap = function(s1, s2) {
  let numX = 0, numY = 0;
  for(let i = 0; i < s1.length; i++) {
    if(s1[i] < s2[i]) {
      numX++;
    } else if(s1[i] > s2[i]) {
      numY++;
    }
  }
  if((numX + numY) % 2 == 1) return -1;
  return Math.floor(numX / 2) + Math.floor(numY / 2) + (numX % 2) * 2;
};
let s1 = "xx", s2 = "yy";
console.log(minimumSwap(s1, s2));
s1 = "xy", s2 = "yx";
console.log(minimumSwap(s1, s2));
s1 = "xx", s2 = "xy";
console.log(minimumSwap(s1, s2));
s1 = "xxyyxyxyxx", s2 = "xyyxyxxxyx";
console.log(minimumSwap(s1, s2));
s1 = "xxyxxyxyxxyxxy", s2 = "yyyxyxyxyyyxxx";
console.log(minimumSwap(s1, s2));
